1. Field of the Invention
This invention relates to image processing system and methods, and more particularly, to systems and methods for detecting edges in an image.
2. Related Art
Image processing systems typically include a camera and components for processing an image signal from the camera. The camera may capture images as digital image data using well-known techniques. The camera may also capture images as analog data, which may be converted to digital image data using well known techniques. The signal processing components may perform image processing functions on the obtained image data in accordance with the application in which the image processing system is utilized. Typical applications use the image processing functions to analyze the image data to detect characteristics of the subject matter of the image. The application may draw conclusions based on the characteristics detected on the image, or perform other functions using the knowledge of the characteristics.
One example of an image processing function is an edge detection function in which image data is analyzed to identify edges, which may appear on the image as lines that separate areas of different intensity magnitudes. Edge detection functions in image processing systems are typically designed to mark or identify as many real edges in the image as possible. The extent to which real edges are marked determines the extent to which an edge detection is a good detection. Edge detection should also achieve a good localization by marking edges as close as possible to the edge in the real image. In addition, a point in the image data that is determined to be an edge point should be as close as possible to a true edge center. The edge detection should also provide a minimal response such that a given edge in the image is marked once and image noise does not create false edges.
Different methods are available to perform edge detection on an image. One example is known as the “Canny filter,” which is named after its developer. Canny filtering involves using a Gaussian filter to smooth the acquired image to produce a slightly blurred version of the original image that is not affected by a single noisy pixel. This helps prevent falsely detecting noise as an edge. The Canny filter method also involves determining a gradient magnitude and angle for each pixel, and detecting the horizontal, vertical and diagonal edges in the blurred image. A non-maxima suppression is performed on the gradient magnitude image by determining whether the gradient magnitude assumes a local maximum in the gradient direction. The non-maxima suppression helps to correctly localize the edge, and to reduce the width of an edge having a width of more than one pixel in the image to the width of one pixel. At an edge where the real width is more than one pixel, the actual edge is deemed to be located at a position where the moment of the gradient has a maximum value. All pixels for which a maximum was determined are kept, whereas the other pixels are set to zero.
A double thresholding or hysteresis thresholding is performed using an upper threshold T2 and a lower threshold T1. The edges that were identified after non-maxima suppression have different intensity values. The image obtained after non-maxima suppression may still contain false edges. False edges are edges in which the gradient is lower than a predetermined threshold. The predetermined threshold actually includes two thresholds, the lower threshold T1 and the upper threshold T2. All pixels in the gradient image having an intensity higher than the upper threshold T2 are considered real edges in the image. All edges having an image intensity lower than T1 are considered false thresholds and are set to zero. The pixels having a gradient intensity higher than T1 and lower than T2 are considered as being an edge when at least one neighboring pixel is also considered an edge pixel. If, however, both neighboring pixels in the direction of the edge are not considered to be an edge pixel, then pixels having a gradient intensity higher than T1 and lower than T2 are not considered to be edge pixels.
Known Canny filter techniques set the two thresholds T1 and T2 to fixed values. However, maintaining the two thresholds fixed may lead to poor edge detection results in environments involving different brightness situations, such as, for example, during the night, or in a foggy or rainy environment. In addition, a multitude of images may be acquired per second and then analyzed to identify objects in the images with high precision. The edge detection should be fast and reliable.
Accordingly, a need exists for improved detection of edges in images that are taken in changing weather conditions or in environments of varying brightness.